import * as THREE from 'three'
// 边缘线类
export class EdgesLine {
  constructor(scene, mesh, color) {
    this.scene = scene
    this.mesh = mesh
    this.color = color
    this.init()
  }
  init() {
    const geometry = this.mesh.geometry
    const edges = new THREE.EdgesGeometry(geometry)
    const line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: this.color }))
    line.position.copy(this.mesh.position)
    line.rotation.copy(this.mesh.rotation)
    line.scale.copy(this.mesh.scale)
    this.scene.add(line)
  }
}